home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / nktools.zip / ENDWAIT.PAS < prev    next >
Pascal/Delphi Source File  |  1990-07-02  |  3KB  |  81 lines

  1. unit EndWait;
  2. (*====================================================================*\
  3. || MODULE NAME:  EndWait                                              ||
  4. || DEPENDENCIES: System                                               ||
  5. || LAST MOD ON:  9006.04                                              ||
  6. || PROGRAMMER:   Naoto Kimura                                         ||
  7. ||                                                                    ||
  8. ||     This unit was developed because of the "feature" of the Turbo  ||
  9. || Pascal (version 5.0) integrated environment which causes it to     ||
  10. || immediately flip back to the edit screen after the program exits.  ||
  11. || Hopefully, this will simplify the usage of Turbo Pascal for the    ||
  12. || Comp 182 students for which this unit was developed.               ||
  13. ||                                                                    ||
  14. || REFERENCE                                                          ||
  15. || MATERIALS:    Turbo Pascal User's Manual                           ||
  16. ||                     Borland International                          ||
  17. ||                                                                    ||
  18. || MODIFICATION HISTORY:                                              ||
  19. || 8905.31       Naoto Kimura                                         ||
  20. ||               Original release                                     ||
  21. || 9004.08       Naoto Kimura                                         ||
  22. ||               Rewrote parts in assembler to reduce size of TPU.    ||
  23. || 9004.10       Naoto Kimura                                         ||
  24. ||               Rewrote same parts as inline statements to eliminate ||
  25. ||               separate assembler file to generate OBJ.             ||
  26. || 9006.04       Naoto Kimura                                         ||
  27. ||               Made minor fix to make code smaller and better.      ||
  28. \*====================================================================*)
  29. {$D-}    {No debug information}
  30. {$R-}    {No range checking}
  31. {$O-}    {Overlay disallowed}
  32. {$S-}    {No stack checking}
  33.  
  34. interface
  35.  
  36. implementation
  37.  
  38. var
  39.     OldExitProc    : Pointer;
  40.  
  41. const
  42.     Msg    : array [0..95] of byte
  43.     = ( $0D,$0A,$2D,$2D, $20,$50,$72,$65, $73,$73,$20,$61,
  44.         $6E,$79,$20,$6B, $65,$79,$20,$74, $6F,$20,$63,$6F,
  45.         $6E,$74,$69,$6E, $75,$65,$20,$2D, $2D,$0D,$0A,$0D,
  46.         $0A,$45,$4E,$44, $57,$41,$49,$54, $2E,$54,$50,$55,
  47.         $20,$20,$20,$20, $20,$20,$20,$20, $20,$20,$20,$20,
  48.         $20,$20,$20,$63, $6F,$70,$79,$72, $69,$67,$68,$74,
  49.         $20,$4E,$61,$6F, $74,$6F,$20,$4B, $69,$6D,$75,$72,
  50.         $61,$20,$28,$30, $34,$2F,$30,$38, $2F,$39,$30,$29 );
  51.  
  52. {$F+}
  53. {static far} procedure Sleep;
  54.     begin
  55.     inline(            {;---- ExitProc := OldExitProc    }
  56.         $8C/$D8/    {  mov  ax,ds            }
  57.         $8E/$C0/    {  mov  es,ax            }
  58.         $BF/ExitProc/    {  mov  di,OFFSET ExitProc    }
  59.         $BE/OldExitProc/{  mov  si,OFFSET OldExitProc    }
  60.         $FC/        {  cld                }
  61.         $A5/        {  movsw            }
  62.         $A5/        {  movsw            }
  63.                 {;---- output prompt        }
  64.         $B8/$4000/    {  mov  ax,4000H        }
  65.         $BB/$02/$00/    {  mov  bx,StdErr        }
  66.         $B9/$25/$00/    {  mov  cx,MsgLen        }
  67.         $BA/Msg/    {  mov  dx,OFFSET Msg        }
  68.         $CD/$21/    {  int  21h            }
  69.                 {;---- clear input buffer    }
  70.         $B8/$0C00/    {  mov  ax,0C00H        }
  71.         $CD/$21/    {  int  21h            }
  72.                 {;---- wait for key        }
  73.         $B4/$00/    {  mov  ah,00H            }
  74.         $CD/$16)    {  int  16h            }
  75.     end;    (* Sleep *)
  76.  
  77. begin
  78.     OldExitProc := ExitProc;
  79.     ExitProc := @Sleep
  80. end.
  81.